class Store < ActiveRecord::Base
#  未转移倒库房四的商品

  has_many :unfilted_products,:class_name => "Inproduct",:foreign_key => "f_store_id"

  has_many :owned_products,:class_name => "Inproduct",:foreign_key => "f_store_id",
      :conditions => "inproducts.l_store_id is null"

  has_many :sent_products,:class_name => "Inproduct",:foreign_key => "f_store_id",
      :conditions => "inproducts.l_store_id = 4"


# 库房四中的商品
  def self.final_products
    Inproduct.all(:conditions => {:l_store_id => 4})
  end

# 前三个库房中的产品
  def self.owned_products
    Inproduct.all(:conditions => {:l_store_id => nil})
  end

#  def all_productions
#
#  end

end
